const Router = require('koa-router')
const { create, getUsers, getAvatar } = require('../controller/user.controller')
const { verifyUser, handlePassword } = require('../milldleware/user.middleware')

const useRouter = new Router({ prefix: '/users' })

// 注册用户
useRouter.post('/', verifyUser, handlePassword, create)
// 获取用户信息
useRouter.get('/:id', getUsers)
// 获取用户头像
useRouter.get('/:id/avatar', getAvatar)

module.exports = useRouter 
